<?php
namespace app\service;

use app\models\Staff;

class StaffService
{
    /**
     * 获取所有在职员工
     * @return array
     */
    public function all_staff(): array
    {
        $model = new Staff();
        $list  = $model->staff_list();
        $arr   = [];
        foreach ($list as $k => $v) {
            if ($v['status'] == 0) {
                $arr[] = $v;
            }
        }
        return $arr;
    }

    /**
     *获取捷克组成员
     *@return array
     */
    public static function jieKeGroup(): array
    {
        $model = new Staff();
        $list  = $model->staff_list();
        $arr   = [];
        foreach ($list as $k => $v) {
            if ($v['group_id'] == 4) {
                $arr[] = $v;
            }
        }
        return $arr;
    }
}
